//
// Created by 张易生 on 2022/1/12.
//

#ifndef ZYSPLAYER_ZYSCALLJAVA_H
#define ZYSPLAYER_ZYSCALLJAVA_H

#include "jni.h"
#include <linux/stddef.h>
#include "AndroidLog.h"

#define MAIN_THREAD 0
#define CHILD_THREAD 1


class ZYSCallJava {
public:
    _JavaVM *javaVM = NULL;
    JNIEnv *jniEnv = NULL;
    jobject jobj;

    jmethodID jmid_prepared;
    jmethodID jmid_time;
    jmethodID jmid_load;
    jmethodID jmid_renderyuv;

public:
    ZYSCallJava(_JavaVM *javaVM, JNIEnv *env, jobject *obj);
    ~ZYSCallJava();

    void onCallPrepared(int type,int total);

    void onCallTimeInfo(int type, int current, int total);

    void onCallLoad(int type, bool load);

    void onCallRenderYUV(int width, int height, uint8_t *fy, uint8_t *fu, uint8_t *fv);

};


#endif //ZYSPLAYER_ZYSCALLJAVA_H
